<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>registerObject()</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.functions.html" title="Chapter 14. Smarty Class Methods">
<link rel="prev" href="api.register.plugin.html" title="registerPlugin()">
<link rel="next" href="api.register.resource.html" title="registerResource()">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">registerObject()</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="api.register.plugin.html">Prev</a> </td>
<th width="60%" align="center">Chapter 14. Smarty Class Methods</th>
<td width="20%" align="right"> <a accesskey="n" href="api.register.resource.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="refentry" title="registerObject()">
<a name="api.register.object"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>registerObject() — register an object for use in the templates</p>
</div>
<div class="refsect1" title="Description">
<a name="id438791"></a><h2>Description</h2>
<code class="methodsynopsis"><span class="type">void </span><span class="methodname">registerObject</span>(<span class="methodparam"><span class="type">string </span><span class="parameter">object_name</span></span>,<br>                    <span class="methodparam"><span class="type">object </span><span class="parameter">object</span></span>,<br>                    <span class="methodparam"><span class="type">array </span><span class="parameter">allowed_methods_properties</span></span>,<br>                    <span class="methodparam"><span class="type">boolean </span><span class="parameter">format</span></span>,<br>                    <span class="methodparam"><span class="type">array </span><span class="parameter">block_methods</span></span>);</code><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
    When you register/assign objects to templates, be sure that all properties and methods accessed from the template are for presentation purposes only. It is very easy to inject application logic through objects, and this leads to poor designs that are difficult to manage. See the Best Practices section of the Smarty website.
  </p>
</div>
<p>
   See the
   <a class="link" href="advanced.features.objects.html" title="Objects">objects section</a>
   for more information.
  </p>
<p>
   See also
   <a class="link" href="api.get.registered.object.html" title="getRegisteredObject()"><code class="varname">getRegisteredObject()</code></a>,
   and
   <a class="link" href="api.unregister.object.html" title="unregisterObject()"><code class="varname">unregisterObject()</code></a>.
  </p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="api.register.plugin.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="api.register.resource.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">registerPlugin() </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> registerResource()</td>
</tr>
</table>
</div>
</body>
</html>
